// header-align 表头对齐方式 left center right
// search 是否显示搜索框
// tableHide 是否在表格中隐藏
// formHide 是否在表单中隐藏, "all" 时，表单中隐藏，数组时,如["edit", "detail"]，则修改和详情不显示
// formDisable 是否在表单中禁用, 数组时,如["edit"]，则修改时禁用
// formRules 表单验证规则
// searchFromRules 搜索表单验证规则
// unit 单位
// width 列表的列宽，数字
// defaultValue 表单的默认值
// searchOrder 搜索框的排序
// tableOrder 表格的排序
export const Model: {
  [key: string]: any;
} = {
  createdAt: {
    width: 150,
    formHide: "all",
    label: "注册日期",
    type: "dateRange",
    search: true,
    searchOrder: 1,
    tableOrder: 2,
  },
  avatar: {
    group: "基本信息",
    label: "头像",
    type: "custom",
    span: 24,
    tableHide: true,
  },
  account: {
    group: "账号信息",
    label: "账号",
    require: true,
    formDisable: ["edit"],
    search: true,
    searchOrder: 3,
    tableOrder: 1,
  },
  password: {
    group: "账号信息",
    label: "密码",
    type: "password",
    require: true,
    tableHide: true,
    formHide: ["edit", "detail"],
  },
  name: {
    group: "基本信息",
    label: "姓名",
    search: true,
    searchOrder: 4,
    formRules: [{ min: 2, message: "姓名不能少于 2 个字符", trigger: "blur" }],
  },
  nickName: {
    group: "基本信息",
    label: "昵称",
    search: true,
  },
  gender: {
    group: "基本信息",
    label: "性别",
    type: "select",
    options: [],
    tableHide: true,
  },
  age: {
    group: "基本信息",
    label: "年龄",
    type: "number",
    min: 0,
    max: 160,
    // 单位
    unit: "岁",
    tableHide: true,
  },
  address: {
    group: "基本信息",
    label: "地址",
    tableHide: true,
  },
  disabled: {
    group: "账号信息",
    label: "禁用",
    type: "switch",
  },
  roles: {
    group: "权限信息",
    label: "角色",
    type: "select",
    options: [],
    multSelect: true,
    tableHide: true,
  },
  department: {
    group: "权限信息",
    label: "部门",
    type: "treeSelect",
    treeData: [],
    // 树的键
    key: "code",
    search: true,
    searchOrder: 2,
    // 表格中显示的字段
    tableTransProp: "department_desc",
  },
  positions: {
    group: "权限信息",
    label: "岗位",
    type: "select",
    options: [],
    multSelect: true,
    tableHide: true,
  },
};
